#pragma GCC optimize(2)
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
#define pi acos(-1.0)
#define e exp(1.0)
//期望值的计算方法：E(x)=p1x1+p2x2+p3x3+……，x是可能的取值，p是出现这种取值的概率 
string s;
int main()
{
//  freopen(".../.txt","w",stdout);
	ios::sync_with_stdio(false);
	cin>>s;
	ll len=s.length();
	ll i,j;
	double sum=0;
	for(i=0;i<len;i++){
		if(s[i]=='+')
		s[i]=' ';
	} 
	stringstream ss(s);
	string a;
	while(ss>>a)
	{
		bool flag=0;
		ll pos=-1;
		ll len1=a.length();
		for(j=0;j<len1;j++){
			if(a[j]=='d'){
				flag=1;
				pos=j;
				break;
			}
		}
		if(!flag){
			ll ans=0;
			for(j=0;j<len1;j++){
				ans=ans*10+a[j]-'0';
			}
			sum+=ans;
		}
		else{
			ll n=0,x=0;
			for(j=0;j<pos;j++)
			n=n*10+a[j]-'0';
			for(j=pos+1;j<len1;j++)
			x=x*10+a[j]-'0';
			double mp=(x*(x+1)/2.0/x)*n;
			sum+=mp;
		}
	}
	if(sum==(ll)sum)
	printf("%.0lf\n",sum);
	else
	printf("%.1lf\n",sum);
	return 0;
}
